<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Amaze UI Admin index Examples</title>
  <meta name="description" content="这是一个 index 页面">
  <meta name="keywords" content="index">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="__AIMG_PATH__favicon.png">
  <link rel="apple-touch-icon-precomposed" href="__AIMG_PATH__app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="__ACSS_PATH__amazeui.min.css"/>
  <link rel="stylesheet" href="__ACSS_PATH__admin.css"> 
  <link rel="stylesheet" type="text/css" href="__ACSS_PATH__bootstrap.css">
  <script src="__AJS_PATH__jquery.min.js"></script>
  <script src="__AJS_PATH__app.js"></script>
  <script src="__AJS_PATH__amazeui.min.js"></script>
  <script type="text/javascript" src="__AJS_PATH__bootstrap.js"></script>
 
</head>
<body>
<!--[if lte IE 9]><p class="browsehappy">升级你的浏览器吧！ <a href="http://se.360.cn/" target="_blank">升级浏览器</a>以获得更好的体验！</p><![endif]-->
</head>
<body>
{layout name='public/layout'}
<div class="admin-biaogelist">
<<<<<<< HEAD
	
=======
    
>>>>>>> 30d92055e9c414d4b857afd0613e979a055c3b0c
    <div class="listbiaoti am-cf">
      <ul class="am-icon-flag on" style="color:lightgreen"> 添加商品</ul>
    </div>
    <div class="fbneirong">
<<<<<<< HEAD
      <form class="am-form" action="" method="" >
        <h3 style="">添加分类</h3>
        <div class="input-group">
          <input type="text" class="form-control" placeholder="请输入类名">
        </div>
        <div class="btn-group" style="margin-left:217px;margin-top:-57px">
          <button type="button" class="btn btn-danger">所属类(默认为第一大类)</button>
          <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="height:34px">
            <span class="caret"></span>
          </button>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
          </ul>
        </div>
        <button type="submit" class="btn btn-default" style="margin-left:20px;margin-top:-52px">点击提交</button>
      </form>
      <form class="am-form" action="" method="" enctype="multipart/form-data">
=======
      <form action="" method="post" class="addlei">
        <h3 style="">添加分类(继承最后一个)</h3>
        <div class="input-group">
          <input type="text" class="form-control" placeholder="请输入类名" id="leiming">
        </div>
        <h4>所属分类</h4>
        <div style="margin-left:0px;margin-top:1px" class='big'>
          <select class="form-control leinum" style="width:250px">
            <option value=0>第一大类(默认)</option>
            {$html}
          </select>
        </div>
      </form>
      <button  style="margin-left:100px;margin-top:52px" id="addlei">点击提交</button>
      
      <form class="am-form" action="__WEB_SITE__admin/addtable/addSpin" method="post" enctype="multipart/form-data">
>>>>>>> 30d92055e9c414d4b857afd0613e979a055c3b0c
        <h3 style="">具体商品</h3>
        <div class="am-form-group am-cf">
          <div class="zuo">商品名：</div>
          <div class="you">
            <input type="text" class="am-input-sm" id="doc-ipt-email-1" name="shangpin" placeholder="请输入标题">
          </div>
        </div>
        <div class="am-form-group am-cf">
          <div class="zuo">关键词：</div>
          <div class="you">
            <input type="text" class="am-input-sm" id="doc-ipt-pwd-1" name="keywords" placeholder="请输入关键词">
          </div>
        </div>
        <div class="am-form-group am-cf">
          <div class="zuo">描述：</div>
          <div class="you">
            <textarea class="" rows="2" id="doc-ta-1" name="jianjie"></textarea>
          </div>
        </div>
<<<<<<< HEAD
         <div class="am-form-group am-cf">
          <div class="zuo">所属分类：</div>
           <div class="btn-group">
          <button type="button" class="btn btn-success">所属类(默认为第一大类)</button>
          <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="height:34px">
            <span class="caret"></span>
          </button>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
          </ul>
        </div>
        </div>
        <div class="am-form-group am-cf">
          <div class="zuo">产品图片：</div>
          <div class="you" style="height: 45px;">
            <input type="file" id="doc-ipt-file-1" name='image'>
=======
        <div class="am-form-group addlei2">
          <div class="zuo">所属分类：</div>

            <div>
              <select class="leinum2" style="width:250px" name='splei'>
                <option value=0>第一大类(默认最后一个)</option>
                {$html}
              </select>
            </div>
        </div>
        <div class="am-form-group am-cf">
          <div class="zuo">产品图片：</div>
          <div class="you" style="height: 70px;">
            <input type="file"  name='image[]'>
            <input type="file"  name='image[]'>
            <input type="file"  name='image[]'>
>>>>>>> 30d92055e9c414d4b857afd0613e979a055c3b0c
            <p class="am-form-help">请选择要上传的文件...</p>
          </div>
        </div>
        <div class="am-form-group am-cf">
          <div class="zuo">生产日期：</div>
          <div class="you">
            <input type="text" class="am-input-sm" id="doc-ipt-email-1" name="shengchan" placeholder="请输入生产日期">
          </div>
        </div>
        <div class="am-form-group am-cf">
          <div class="zuo">保质期：</div>
          <div class="you">
            <input type="text" class="am-input-sm" id="doc-ipt-email-1" name="baozhiqi" placeholder="请输入保质期">
          </div>
        </div>
         <div class="am-form-group am-cf">
          <div class="zuo">产地：</div>
          <div class="you">
            <input type="text" class="am-input-sm" id="doc-ipt-email-1" name="chandi" placeholder="请输入产地">
          </div>
        </div>
        <div class="am-form-group am-cf">
          <div class="zuo">储存温度：</div>
          <div class="you">
            <input type="text" class="am-input-sm" id="doc-ipt-email-1" name="chucunwendu" placeholder="请输入储存温度">
          </div>
        </div>
         <div class="am-form-group am-cf">
          <div class="zuo">包装方式:</div>
          <div class="you">
            <input type="text" class="am-input-sm" id="doc-ipt-email-1" name="baozhuang" placeholder="请输入包装方式">
          </div>
        </div>
         <div class="am-form-group am-cf">
          <div class="zuo">总量:</div>
          <div class="you">
            <input type="text" class="am-input-sm" id="doc-ipt-email-1" name="num" placeholder="请输入总量">
          </div>
        </div>
         <div class="am-form-group am-cf">
          <div class="zuo">商品价格:</div>
          <div class="you">
<<<<<<< HEAD
            <input type="text" class="am-input-sm" id="doc-ipt-email-1" name="jianjie" placeholder="请输入价格">
=======
            <input type="text" class="am-input-sm" id="doc-ipt-email-1" name="yuanjia" placeholder="请输入价格">
>>>>>>> 30d92055e9c414d4b857afd0613e979a055c3b0c
          </div>
        </div>
         <div class="am-form-group am-cf">
          <div class="zuo">最高可抵积分:</div>
          <div class="you">
            <input type="text" class="am-input-sm" id="doc-ipt-email-1" name="jifen" placeholder="请输入">
          </div>
        </div>
        <div class="am-form-group am-cf">
<<<<<<< HEAD
          <div class="zuo">商品活动:</div>
=======
          <div class="zuo">商品活动(默认无):</div>
>>>>>>> 30d92055e9c414d4b857afd0613e979a055c3b0c
          <div class="you" style="margin-top: 5px;">
            <label class="am-checkbox-inline">
              <input type="checkbox" name="huodong[]" value="2">
              秒杀活动</label>
             <label class="am-checkbox-inline">
              <input type="checkbox" name="huodong[]" value="3">
              拍卖活动</label>
               <label class="am-checkbox-inline">
              <input type="checkbox" name="huodong[]" value="4">
              特价优惠活动</label>
              </div>
        </div>
        <div class="am-form-group am-cf">
<<<<<<< HEAD
=======
          <div class="zuo">优惠劵(默认无):</div>
          <div class="you" style="margin-top: 5px;">
            <label class="am-checkbox-inline">
              <input type="checkbox" name="juan[]" value="1">
              10元优惠劵(满 {$juan[0]['man']}元 | 余量:{$juan[0]['counts']})</label>
             <label class="am-checkbox-inline">
              <input type="checkbox" name="juan[]" value="2">
              20元优惠劵(满 {$juan[1]['man']}元 | 余量:{$juan[1]['counts']})</label>
               <label class="am-checkbox-inline">
              <input type="checkbox" name="juan[]" value="3">
              30元优惠劵(满 {$juan[2]['man']}元 | 余量:{$juan[2]['counts']})</label>
              </div>
        </div>
        <div class="am-form-group am-cf">
>>>>>>> 30d92055e9c414d4b857afd0613e979a055c3b0c
          <div class="you" style="margin-left: 11%;">
             <button type="submit" class="am-btn am-btn-secondary am-radius">点击上架</button>
          </div>
        </div>
      </form>
    </div>
</div>
<<<<<<< HEAD

=======
<!-- 处理商品类/商品的增加 -->
        <script type="text/javascript">
          //增加商品
              var parent_id = null;
              $('#addlei').click(function(){
                 var fenlei = $('#leiming').val();
                 var leinum = $('.leinum').last().val();
                  if (!fenlei) {
                      $('#leiming').css('background','lightgreen').attr('placeholder','请填写类名');
                  };
                 if (leinum == 's') {
                    leinum = parent_id;
                 };
                 $.post('__WEB_SITE__admin/addtable/addsplei',{fenlei:fenlei,prev_id:leinum},function(data){
                      if (data) {
                        window.location.reload();
                      };
                    
                 },'json');
              }); 
          //遍历子类
             
              function zilei(num,num2,types)
              {
                
                  $(num).last().change(function(){
                      var fid = this.value;
                      if (fid == 0) {
                        return false;
                      };
                      if (fid == 's') {
                        return false;
                      };
                       $.post('__WEB_SITE__admin/addtable/allZilei',{prev_id:fid,type:types},function(data){
                        if (data['html']) {
                          parent_id = data['parent_id'];
                          $(num).eq(1).remove();
                          $(num2).add(data['html']).appendTo($(num2));
                           zilei(num,num2,types);
                         };   
                         },'json');
                });
              }
           
              zilei('.leinum','.addlei','aaa');     
              zilei('.leinum2','.addlei2','bbb');     
        </script>
>>>>>>> 30d92055e9c414d4b857afd0613e979a055c3b0c
</body>
</html>